package Logic;

import Core.Log4j2;
import za.co.luma.geom.Vector2DDouble;
import za.co.luma.math.sampling.Sampler;
import za.co.luma.math.sampling.UniformPoissonDiskSampler;

import java.util.List;

public class PointGenerator {
    private static PointGenerator instance;
    private static int offset = 1000;

    public static PointGenerator Instance() {
        if (instance == null) {
            instance = new PointGenerator();
        }
        return instance;
    }

    public List<Vector2DDouble> GenSpawnPoints(int mapId, float minDist) {
        Quad quad = new Quad();
        Util.GetMapCorners(mapId, quad);
        Sampler<Vector2DDouble> sampler = new UniformPoissonDiskSampler(quad.xMin + offset, quad.yMin + offset, quad.xMax - offset, quad.yMax - offset, minDist);
        List<Vector2DDouble> pointList = sampler.sample();
        return pointList;
    }
}
